<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <div id="app">
      <h3>编译作用域</h3>
      <child> {{ count }} </child>
    </div>

    <script src="../Vue.js"></script>
    <script>
      // 哪个组件的template就用哪个组件的作用域

      // 后备内容就是slot标签的默认值，写在slot标签里面，没传内容的时候会显示
      const Child = {
        template: `
          <div>
            child - <slot>99999</slot>
          </div>
        `,
      };

      new Vue({
        el: "#app",
        data() {
          return {
            count: 10,
          };
        },
        components: {
          Child,
        },
      });
    </script>
  </body>
</html>
